package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClick(View view) {
        Button btn = (Button)view;
//        Toast.makeText(MainActivity.this, btn.getText(), Toast.LENGTH_SHORT).show();
        TextView tv = (TextView)findViewById(R.id.show_text);
        String show_text = tv.getText() + " " + btn.getText();
        tv.setText(show_text);
    }
}